﻿using System.Collections.Generic;
using Scrubblet.FrontEnd.Models.Entities;

namespace Scrubblet.FrontEnd.Models
{
    public class GameModel
    {
        public GameModel()
        {
            NewGameData = new NewGameModel();
            Games = new List<GameInfo>();
        }

        public bool IsNewGame { get; set; }
        public NewGameModel NewGameData { get; set; }
        public Game SelectedGame { get; set; }
        public List<GameInfo> Games { get; set; }
    }

    public class GameInfo
    {
        public string Id { get; set; }
        public string Name { get; set; }
    }

    public class Game
    {
        public Game(int width, int height)
        {
            Width = width;
            Height = height;
            Field = new string[width, height];
            CellTypes = new BoardCellType[width, height];
        }

        public string Id { get; set; }
        public string Name { get; set; }
        public int Width { get; set; }
        public int Height { get; set; }

        private string[,] Field { get; set; }

        public string this [int i, int j]
        {
            get { return Field[i, j]; }
            set { Field[i, j] = value; }
        }

        public List<string> PlayerLetters { get; set; }

        public BoardCellType[,] CellTypes { get; set; }
    }

    public class NewGameModel
    {
        public NewGameModel()
        {
            Boards = new List<GameBoard>();
            Alphabets = new List<GameAlphabet>();
        }

        public string Name { get; set; }
        public string SelectedBoard { get; set; }
        public string SelectedAlphabet { get; set; }
        public List<GameBoard> Boards { get; set; }
        public List<GameAlphabet> Alphabets { get; set; }
    }

    public class GameBoard
    {
        public int Id { get; set; }
        public string Name { get; set; }
    }

    public class GameAlphabet
    {
        public int Id { get; set; }
        public string Name { get; set; }
        
    }


}